package development;

import state.GameConstants;
import state.GameForm;
import state.GameImage;
import state.Graphics;
import state.Key;
import state.util.GameColor;
import state.util.Hashtable;
import state.util.ImageUtil;
import stateframework_particle.view.StateFramework_ParticleResources;

public class FrmTestResizeImage extends GameForm {

  private GameImage testImage = null;

  private static GameForm singleton = null;

  public static GameForm instance() {
    if (singleton == null) {
      singleton = new FrmTestResizeImage();
    }
    return singleton;
  }

  public void init(Hashtable parameters) {
    _manager.setBackGroundColor(GameColor.BLACK_CODE);

    testImage = new GameImage(StateFramework_ParticleResources.image_HOT80_3, null, null).setStatic(true);
    testImage = ImageUtil.resizeImage2(testImage, GameConstants.SCREEN_WIDTH, GameConstants.SCREEN_HEIGHT);
  }

  public void draw(Graphics g) {
    g.drawImage(testImage, Constants.SCREEN_WIDTH / 2, Constants.SCREEN_HEIGHT / 2, Constants.CENTER_ANCHOR);
  }

  public void keyReleased(int keyCode) {
    if (keyCode == Key.SOFT_RIGHT) {
      Global.nextState(FrmMenu.instance(), null);
    }
  }

  public void destroy() {
  }
}
